package Java.BlackHorse.Thread.ThreadMethod2;

public class ThreadDemo {
    /*
    * setPriority(int newPriority) 设置线程的优先级
    * final int getPriority() 获取线程优先级
    * */
    public static void main(String[] args) {
        MyRunnable mr = new MyRunnable();
        Thread t1 = new Thread(mr,"Thread 1");
        Thread t2 = new Thread(mr,"Thread 2");

        int p1 = t1.getPriority();
        int p2 = t2.getPriority();


        t1.setPriority(10);
        t2.setPriority(1);

        System.out.println(p1 + "   " +p2);

        t1.start();
        t2.start();

    }
}
